﻿using System;
using System.Collections.Generic;
using System.Text;

namespace IceDog.DNL.CSharp.DesignPattern.BusinessDelegatePattern.StudentManage
{
    /// <summary>
    /// 业务委托
    /// </summary>
    public class BusinessDelegate
    {
        private readonly BusinessServiceLookUp _lookupService;
        private IBusinessService _businessService;
        public ServerType ServiceType { get; set; }

        public BusinessDelegate()
        {
            _lookupService = new BusinessServiceLookUp();
        }
        
        public void DoTask()
        {
            _businessService = _lookupService.GetBusinessService(ServiceType);
            _businessService.DoProcessing();
        }
    }
}
